# @Filename:    Sample1-add
# @Author:      王佳伟
# @Time:        2025-02-28 9:25
# @Describe:    字符串替换
import unittest


def replace_substring(s, old, new):
    return s.replace(old, new)


class TestReplaceSubstring(unittest.TestCase):
    def test_replace_substring(self):
        self.assertEqual(replace_substring("hello world", "world", "python"), "hello python")
        self.assertEqual(replace_substring("aaa", "a", "b"), "bbb")


if __name__ == '__main__':
    unittest.main()
